<?php
if (isset($_POST['btn']))
{
    $y=$_POST['year'];
    if ($y==''||!is_numeric($y)||$y<0)
    {
        echo "输出的年份{$y}必须是整数";
    }
    else
    {
        $y+=0;
        if (is_int($y))
        {
            if ($year%4==0 && $year%100!=0 || $year%400==0)
            {
                echo "是闰年";
            }
            else
            {
                echo "不素";
            }
        }
        else
        {
            echo "你输出的不是｛$y｝整数";
        }
    }
}
?>
<form method="post" action="">
    请输如年份<input type="text" name="year"><br>;
    <input type="submit" name="btn" value="判断年份">
</form>